<!DOCTYPE html>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <style type="text/css">
        .tdcontent{
            overflow:hidden;
            white-space:nowrap;
            text-overflow:ellipsis;
        }
    </style>
</head>

<body>
    <jsp:include page="../frame.jsp"></jsp:include>
    <link href="/yibinu_certificate/static/assets/bootstrap-table/css/bootstrap-table.css" rel="stylesheet" />
    <script src="/yibinu_certificate/static/assets/bootstrap-table/js/bootstrap-table.js"></script>
    <script src="/yibinu_certificate/static/assets/bootstrap-table/locale/bootstrap-table-zh-CN.js"></script>
    <div id="page-wrapper" >
        <div class="header">
            <h1 class="page-header">
                二级学院信息管理
            </h1>
            <ol class="breadcrumb">
                <li><a href="/yibinu_certificate/index">首页</a></li>
                <li><a href="">二级学院信息管理</a></li>
                <li class="active">二级学院信息列表</li>
            </ol>

        </div>

        <div id="page-inner">

            <div class="row">
                <div class="col-md-12">
                    <div class="card">
                        <div class="card-action">
                            二级学院信息表
                        </div>
                        <div class="card-content">
                            <div>${msg}</div>
                            <div class="table-responsive">
                                <table class="table table-striped table-bordered table-hover" id="table-school">
                                </table>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <!-- /. PAGE INNER  -->
    </div>
    <!-- /. PAGE WRAPPER  -->
</div>
<!-- /. WRAPPER  -->
</body>
<script type="text/javascript">

    var $table = $('#table-school');
    $().ready(function(){
        $table.bootstrapTable({
            url : '/yibinu_certificate/school/getAllSchool',
            method : 'POST',
            search : true,
            searchAlign : 'left',
            showRefresh : true,
            showHeader : true,
            showToggle : true,
            showColumns : true,
            pagination: true,
            pageSize: 5,
            pageList: [5,10,25,50,100],
            columns : [ {
                field : 'schoolName',
                title : '二级学院名称',
                align: 'left',
                valign: 'middle',
                class : 'tdcontent',
                sortable : true
            } ,{
                field : 'actions',
                title : '操作',
                formatter : operateFormatter,
            } ],
            silent : true,
            formatNoMatches : function () {
                return '没有符合条件的记录';
            }
        });

        // 判断是手机访问
        if(/Android|webOS|iPhone|iPod|BlackBerry/i.test(navigator.userAgent)) {
            // 修改样式
            $('.search').css({"width":"100%"});
            $('.columns').css({"padding-right":"20%"});
            $('.columns').css({"padding-left":"20%"});
        }
    });


    /**
     * 最后一列加入操作
     * @author 子墨
     * @date 2018/8/25 17:55
     * @params
     * @return
     */
    function operateFormatter(value, row, index) {
        return [
            '<div class="hidden-sm hidden-xs action-buttons">\n' +
            '                                                        <a href="export" title="一键导出Excel">\n' +
            '                                                            <i class="fa fa-file-word-o bigger-130"></i>\n' +
            '                                                        </a>\n' +
            '\n' +
            '                                                        <a href="add" title="添加">\n' +
            '                                                            <i class="fa fa-plus bigger-130"></i>\n' +
            '                                                        </a>\n' +
            '\n' +
            '                                                        <a href="update?id='+row.id+'" title="编辑">\n' +
            '                                                            <i class="fa fa-pencil bigger-130"></i>\n' +
            '                                                        </a>\n' +
            '\n' +
            '                                                        <a href="delete?id='+row.id+'" title="删除">\n' +
            '                                                            <i class="fa fa-trash-o bigger-130"></i>\n' +
            '                                                        </a>\n' +
            '                                                    </div>\n' +
            '\n' +
            '                                                    <div class="hidden-md hidden-lg">\n' +
            '                                                        <div class="inline pos-rel">\n' +
            '                                                            <button class="btn btn-minier btn-yellow dropdown-toggle" data-toggle="dropdown" data-position="auto">\n' +
            '                                                                <i class="fa fa-caret-down icon-only bigger-120"></i>\n' +
            '                                                            </button>\n' +
            '\n' +
            '                                                            <ul class="dropdown-menu dropdown-only-icon dropdown-yellow dropdown-menu-right dropdown-caret dropdown-close">\n' +
            '                                                                <li>\n' +
            '                                                                    <a href="export" class="tooltip-info" data-rel="tooltip" title="导出">\n' +
            '                                                                        <span>\n' +
            '                                                                            <i class="fa fa-file-word-o bigger-120"></i>\n' +
            '                                                                        </span>\n' +
            '                                                                    </a>\n' +
            '                                                                </li>\n' +
            '\n' +
            '                                                                <li>\n' +
            '                                                                    <a href="add" class="tooltip-info" data-rel="tooltip" title="新增">\n' +
            '                                                                        <span>\n' +
            '                                                                            <i class="fa fa-plus bigger-120"></i>\n' +
            '                                                                        </span>\n' +
            '                                                                    </a>\n' +
            '                                                                </li>\n' +
            '\n' +
            '                                                                <li>\n' +
            '                                                                    <a href="update?id='+row.id+'" class="tooltip-success" data-rel="tooltip" title="编辑">\n' +
            '                                                                        <span>\n' +
            '                                                                            <i class="fa fa-pencil-square-o bigger-120"></i>\n' +
            '                                                                        </span>\n' +
            '                                                                    </a>\n' +
            '                                                                </li>\n' +
            '\n' +
            '                                                                <li>\n' +
            '                                                                    <a href="delete?id='+row.id+'" class="tooltip-error" data-rel="tooltip" title="删除">\n' +
            '                                                                    <span>\n' +
            '                                                                        <i class="fa fa-trash-o bigger-120"></i>\n' +
            '                                                                    </span>\n' +
            '                                                                    </a>\n' +
            '                                                                </li>\n' +
            '                                                            </ul>\n' +
            '                                                        </div>\n' +
            '                                                    </div>'
        ].join('');
    }
</script>

</html>